<?php
$this->widget('tlbExcelView', array(
    'dataProvider'=> $dataProvider,
    'id'                   => 'some-grid',
    'grid_mode'            => 'export', // Same usage as EExcelView v0.33
    'title'                => 'HY'.date('YmdHis'),
    'creator'              => '联通华盛',
    'subject'              => mb_convert_encoding('Something important with a date in French: ' . utf8_encode(strftime('%e %B %Y')), 'ISO-8859-1', 'UTF-8'),
    'sheetTitle'           => '合约销售日报'.date('YmdHis'),
//    'landscapeDisplay'     => true, // Default: false
//    'A4'                   => false, // Default: false - ie : Letter (PHPExcel default)
    //'pageFooterText'       => '&RThis is page no. &P of &N pages', // Default: '&RPage &P of &N'
    //'automaticSum'         => true, // Default: false
    'decimalSeparator'     => ',', // Default: '.'
    'thousandsSeparator'   => '.', // Default: ','
    'borderColor'          => '00FF00', // Default: '000000'
    'bgColor'              => 'FFFF00', // Default: 'FFFFFF'
    'textColor'            => 'FF0000', // Default: '000000'
    'rowHeight'            => 20, // Default: 15
    'headerBorderColor'    => 'FF0000', // Default: '000000'
    'headerBgColor'        => 'CCCCCC', // Default: 'CCCCCC'
    'headerTextColor'      => '0000FF', // Default: '000000'
    'headerHeight'         => 20, // Default: 20
    'footerBorderColor'    => '0000FF', // Default: '000000'
    'footerBgColor'        => '00FFCC', // Default: 'FFFFCC'
    'footerTextColor'      => 'FF00FF', // Default: '0000FF'
    'footerHeight'         => 20, // Default: 20
     'columns'=>array(
				array(
					'name'=>'trade_type',
                    'value'=>'$data->tradeType->tradetype_name',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'trade_date',
                    'value'=>'$data->trade_date',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
                    //'header'=>'日期'
				),
					/*
				array(
                    'value'=>'$row+1',
                    'header'=>'序号',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),*/
				array(
					'name'=>'tradeStaff.eparchy_code',
					'value'=>'$data->tradeStaff->eparchyCode->eparchy_name',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'tradeStaff.depart_code',
					'value'=>'$data->tradeStaff->departCode->depart_name',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'trade_staff',
					'value'=>'$data->tradeStaff->user_name',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'trade_method',
					'value'=>'$data->tradeMethod->method_name',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'trade_user_type',
					'value'=>'isset($data->tradeUserType)?$data->tradeUserType->usertype_name:"未知"',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'producttype_code',
					'value'=>'$data->producttypeCode->producttype_name',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'product_id',
					'value'=>'$data->product->specification',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'bill_fee',
					'value'=>'$data->bill_fee',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'phone_fee',
					'value'=>'$data->phone_fee',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'check_profit',
					'value'=>'$data->check_profit',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				/*
				array(
					'name'=>'real_profit',
					'value'=>'$data->real_profit',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				*/
				
			    /*
				array(
					'class'=>'CButtonColumn',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
					'header'=>'操作',
				),
				*/
			), 
));

?>